package com.ygo.feihua.adapter;

import android.content.*;
import android.view.*;
import android.widget.*;
//import com.qnw.CardGroupManagement.bean.*;
import com.ygo.feihua.*;
import java.util.*;

public class AdapterTextview extends BaseAdapter
{
    private Context context;
    private List<String> data;
	//private List<DeckType> datas;
	private Zujian zujian;
	
    public AdapterTextview(Context context, List<String> data)
	{
        this.context = context;
        this.data = data;
    }
	
	/*public AdapterTextview(Context context, List<DeckType> datas)
	{
        this.context = context;
        this.datas = datas;
    }*/
	
	class  Zujian
	{
        TextView it_text;
    }

    public void sx(){
		notifyDataSetChanged();
	}
    
    @Override
    public int getCount()
    {
        // TODO: Implement this method
		//if(data!=null){
        return data.size();
	/*	}else{
			return datas.size();
		}*/
    }

    @Override
    public Object getItem(int p1)
    {
        // TODO: Implement this method
		//if(data!=null){
        return data.get(p1);
	/*	}else{
			return datas.get(p1);
		}*/
    }

    @Override
    public long getItemId(int p1)
    {
        // TODO: Implement this method
        return p1;
    }

    @Override
    public View getView(int position, View p2, ViewGroup p3)
    {
        // TODO: Implement this method
      if(p2==null){
          zujian=new Zujian();
          p2=LayoutInflater.from(context).inflate(R.layout.item_text,null);
          
          zujian.it_text=(TextView) p2.findViewById(R.id.it_text);
          p2.setTag(zujian);
      }else{
          zujian=(Zujian)p2.getTag();
      }
  //    if(data!=null){
      zujian.it_text.setText(data.get(position));
	/*  }else if(datas!=null){
		 zujian.it_text.setText(datas.get(position).getName());  
	  }*/
          return p2;//返回设置好的view组件，也可以是布局，也可以是控件 
    }
}
